﻿// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

var light = new Light();
var remote = new RemoteControl();

// 绑定“开灯”命令
remote.SetCommand(new LightOnCommand(light));
remote.PressButton(); // 灯亮了

// 撤销
remote.PressUndo();   // 灯灭了